Turns out the tests don't actually need this "more deterministic" output and it
was also showing up relatively high in profiles (e.g. ~15% of a noop runtime) so
if this is necessary let's find a better way!
for unit in units {
build(&mut ret, cx, unit);
}
-
- // Make the output a little more deterministic by sorting all dependencies
- for (_, slot) in ret.iter_mut() {
- slot.to_link.sort_by(|a, b| a.0.cmp(&b.0));
- slot.to_link.dedup();
- slot.plugins.sort();
- slot.plugins.dedup();
- }
cx.build_scripts.extend(ret.into_iter().map(|(k, v)| {
(k, Arc::new(v))
}));
execs().with_status(0)
.with_stdout(&format!("\
{compiling} foo v0.0.1 ([..])
-{running} `rustc src/main.rs [..]`
-{running} `rustc src/main.rs [..]`
+{running} `rustc src[..]main.rs [..]`
+{running} `rustc src[..]main.rs [..]`
", compiling = COMPILING, running = RUNNING)));
});